package com.heop.game.example;

import android.os.Bundle;

import com.heop.game.example.Listener.BaseListener;
import com.heop.system.GameActivity;
import com.heop.system.IGameListener;

public class ExampleActivity extends GameActivity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		Bundle bundle = getIntent().getExtras();
		String className = (String)bundle.get("classname");
		
		try {
			setGameListener((IGameListener)Class.forName(className).newInstance());
		} 
		catch (IllegalAccessException e) {
			e.printStackTrace();
		} 
		catch (InstantiationException e) {
			e.printStackTrace();
		} 
		catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}

	@Override
	protected IGameListener initListener() {
		return new BaseListener();
	}

}
